package com.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.blog.service.entity.BbsComment;
import com.blog.service.inter.BbsCommentService;
import com.blog.service.model.BbsCommentMapper;

/**
 * 文件名： com.blog.service.impl.BbsCommentServiceImpl.java
 * 作者： WenBin
 * 日期： 2017年4月12日
 * 功能说明： 留言板服务实现类
 * =========================================================
 * 修改记录：
 * 修改作者 日期 修改内容
 * =========================================================
 * Copyright (c) 2010-2011 .All rights reserved.
 */
@Service
public class BbsCommentServiceImpl implements BbsCommentService {

	@Autowired
	private BbsCommentMapper bbsCommentMapper;

	@Override
	public BbsComment saveBbsComment(BbsComment bbsComment) {

		int i = bbsCommentMapper.insertSelective(bbsComment);
		if (i > 0) {
			return bbsComment;
		}
		return null;
	}

	@Override
	public BbsComment updateBbsComment(BbsComment bbsComment) {

		int i = bbsCommentMapper.updateByPrimaryKey(bbsComment);
		if (i > 0) {
			return bbsComment;
		}
		return null;
	}

	@Override
	public BbsComment deleteBbsComment(BbsComment bbsComment) {

		int i = bbsCommentMapper.deleteByPrimaryKey(bbsComment.getBbsCommentId());
		if (i > 0) {
			return bbsComment;
		}
		return null;
	}

}
